Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export prometheus metrics #145

Merged
merged 4 commits into from
Aug 18, 2020
Merged

Conversation

diogonicoleti
Copy link
Contributor

I would like to monitor some behaviors of the injector, so I added the metrics endpoint that export some prometheus metrics.

Just for now, this just export the default metrics for go apps, but we can add injector specific metrics in the future (like this one: #17).

@hashicorp-cla
Copy link

hashicorp-cla commented Jun 9, 2020

CLA assistant check
All committers have signed the CLA.

@diogonicoleti
Copy link
Contributor Author

cc/ @jasonodonnell

@jasonodonnell jasonodonnell self-requested a review June 11, 2020 14:38
Copy link
Contributor

@jasonodonnell jasonodonnell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @diogonicoleti, this looks great! Thanks for adding this feature.

I think this should be an opt-in feature, so the handler should be enabled via flag/env (we can add configurables to Vault Helm to enable/disable it). The reason I think it should be opt-in is we don't own the metric code being served by the handler, so if there's an issue upstream that causes a panic, it can bring down the whole injector.

Thoughts?

@diogonicoleti
Copy link
Contributor Author

@jasonodonnell done! I added a new flag telemetry-path to set the metrics path. If this flag is not set, the prometheus handler is not registered, so we don't have any issue.

@jasonodonnell jasonodonnell self-requested a review August 18, 2020 21:25
Copy link
Contributor

@jasonodonnell jasonodonnell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@jasonodonnell jasonodonnell merged commit 77cd69e into hashicorp:master Aug 18, 2020
RemcoBuddelmeijer pushed a commit to RemcoBuddelmeijer/vault-k8s that referenced this pull request Feb 22, 2022
* Add Prometheus metrics endpoint

* Add flag to define telemetry path

* Upgrade prometheus client dependency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants